﻿<UserControl
	x:Class="DeltaEngine.Editor.Emulator.ViewportControl"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:local="clr-namespace:DeltaEngine.Editor.Emulator"
	xmlns:helpers="clr-namespace:DeltaEngine.Editor.Emulator.Helpers"
	mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="500"
	d:DataContext="{d:DesignInstance Type=helpers:DesignViewportControl, IsDesignTimeCreatable=True}"
	MinHeight="300" MinWidth="300" Background="Black">
	<DockPanel>
		<Grid DockPanel.Dock="Top" Name="ToolPane" Height="60" Visibility="Collapsed">
			<Grid.RowDefinitions>
				<RowDefinition Height="30" />
				<RowDefinition Height="30" />
			</Grid.RowDefinitions>
			<TextBlock Grid.Row="0" Text="Toolbox" Background="#FFACACAC" Foreground="White" FontFamily="Arial" FontSize="18"
			           FontWeight="Bold" Padding="5,5,0,0" />
			<ListBox
				Grid.Row="1" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
				Name="UIToolbox" PreviewMouseLeftButtonDown="ClickingOnButton" PreviewMouseLeftButtonUp="CreateNewSceneControl"
				ItemsSource="{Binding Path=Tools}" Background="#FFF3F3F3">
				<ListBox.ItemTemplate>
						<DataTemplate>
							<StackPanel Orientation="Horizontal">
								<local:ToolboxEntry
									Cursor="Hand" PreviewMouseMove="CreateAndDragNewSceneControl"
									DataContext="{Binding}" />
						</StackPanel>
					</DataTemplate>
				</ListBox.ItemTemplate>
				<ListBox.ItemsPanel>
					<ItemsPanelTemplate>
						<WrapPanel/>
					</ItemsPanelTemplate>
				</ListBox.ItemsPanel>
			</ListBox>
		</Grid>
		<WindowsFormsHost Name="ViewportHost" x:FieldModifier="public" Width="1" Height="1" />
	</DockPanel>
</UserControl>